<%@ page import="bean.load" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="bean.record" %>
<%--
  Created by IntelliJ IDEA.
  User: zhujun
  Date: 2023/1/7
  Time: 5:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <meta charset="utf-8">
  <title>打印预约挂号单</title>
  <link rel="stylesheet" type="text/css" href="../css/table.css">
  <link rel="stylesheet" type="text/css" href="../css/register.css">
</head>
<body>
<%@include file="header2.jsp"%>
<%
  load ld = new load();
  HttpSession session1=request.getSession();
  String ur=(String) session1.getAttribute("ur");
  String SQL = "select*from reg where id='"+ur+"'";
  ArrayList<record> ar = ld.loadrecord(SQL);
  String n1,n2,n3,n4;
%>
<h3>个人有效预约挂号：</h3>
<table>
  <tr>
    <th>编号</th>
    <th>用户名</th>
    <th>医生编号</th>
    <th>预约挂号时间</th>
  </tr>
  <%
    for(int i=0;i<ar.size();i++){
      n1=ar.get(i).getRec_id();
      n2=ar.get(i).getId();
      n3=ar.get(i).getDoc_id();
      n4=ar.get(i).getRec_time();
  %>
  <tr>
    <td><%=n1%></td>
    <td><%=n2%></td>
    <td><%=n3%></td>
    <td><%=n4%></td>
  </tr>
  <%
    }
  %>
</table>

<h3>打印预约挂号单</h3>
<div>
  <form action="table7.jsp" method="post">
    <label for="fname">医生编号</label>
    <input type="text" id="fname" name="ur1" placeholder="输入编号">
    <br>
    <input type="submit" value="提交">
    <input type="reset" value="重置">
  </form>
</div>
</body>
</html>
